'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
    */
    return queryInterface.sequelize.transaction(async t => {
      await queryInterface.bulkInsert("sys_dict_type", [
        {
          dict_id:1,
          dict_name:"用户性别",
          dict_type:"sys_user_sex",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"用户性别列表",
          created_at: new Date(),
          updated_at: new Date()
        },{
          dict_id:2,
          dict_name:"菜单状态",
          dict_type:"sys_show_hide",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"菜单状态列表",
          created_at: new Date(),
          updated_at: new Date()
        },{
          dict_id:3,
          dict_name:"系统开关",
          dict_type:"sys_normal_disable",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"系统开关列表",
          created_at: new Date(),
          updated_at: new Date()
        },{
          dict_id:4,
          dict_name:"任务状态",
          dict_type:"sys_job_status",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"任务状态列表",
          created_at: new Date(),
          updated_at: new Date()
        },{
          dict_id:5,
          dict_name:"任务分组",
          dict_type:"sys_job_group",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"任务分组列表",
          created_at: new Date(),
          updated_at: new Date()
        },{
          dict_id:6,
          dict_name:"系统是否",
          dict_type:"sys_yes_no",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"系统是否列表",
          created_at: new Date(),
          updated_at: new Date()
        },{
          dict_id:7,
          dict_name:"通知类型",
          dict_type:"sys_notice_type",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"通知类型列表",
          created_at: new Date(),
          updated_at: new Date()
        },{
          dict_id:8,
          dict_name:"通知状态",
          dict_type:"sys_notice_status",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"通知状态列表",
          created_at: new Date(),
          updated_at: new Date()
        },{
          dict_id:9,
          dict_name:"操作类型",
          dict_type:"sys_oper_type",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"操作类型列表",
          created_at: new Date(),
          updated_at: new Date()
        },{
          dict_id:10,
          dict_name:"系统状态",
          dict_type:"sys_common_status",
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"登录状态列表",
          created_at: new Date(),
          updated_at: new Date()
        },
      ], { transaction: t });
    })
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    return queryInterface.sequelize.transaction(async t => {
      return await queryInterface.bulkDelete("sys_dict_type", null, { transaction: t });
    })
  }
};
